function showFirstLevel(){
	var selectObject = document.getElementById("firstLevel");
	categoryManager.findAllCategory(function(categoryList){
	selectObject.options.length = 0;
	var empty = new Option('不填为一级分类','empty');
	selectObject.options.add(empty);
		for(var i=0; i<categoryList.length; i++){
			var size = categoryList[i].catid.length;
			if(size == 3){
				var object = new Option(categoryList[i].catname,categoryList[i].catid);
				selectObject.options.add(object);
			}//end if
		}//end if
	});// end dwr
}

function showSecondLevel(){
	var selectObject = document.getElementById("secondLevel");
	var firstLevelId = $('#firstLevel').val();
	categoryManager.findAllCategory(function(categoryList){
	selectObject.options.length = 0;
	var empty = new Option('不填为二级分类','empty');
	selectObject.options.add(empty);
		for(var i=0; i<categoryList.length; i++){
			var size = categoryList[i].catid.length;
			if(size == 6){//判断是否是一级分类下的二级分类
				if(firstLevelId == categoryList[i].catid.substr(0,3)){		
					var object = new Option(categoryList[i].catname,categoryList[i].catid);
					selectObject.options.add(object);
				}
			}
		}//end for
	});// end dwr
}

//设置要提交的Id通过一级与二级分类来选择
function setAssetCategoryId(){
	var firstLevelId = $('#firstLevel').val();
	var secondLevelId = $('#secondLevel').val();
	var assetCategoryId = $('#assetCategoryId');
	if(firstLevelId != 'empty'){
		assetCategoryId.val(firstLevelId);
		if(secondLevelId != 'empty'){
			assetCategoryId.val(secondLevelId);
		}else{
			assetCategoryId.val(firstLevelId);
		}
	}else{
		assetCategoryId.val('0');
	}
}

function request(strParame){
	var args = new Object();
	//获取的?assetCategoryId=xxx;并去掉?
	var query = location.search.substr(1);
	//截取多个参数
	var pairs = query.split('&');
	for(var i=0; i<pairs.length; i++){
		var pos = pairs[i].indexOf('=');
		if(pos == -1) continue;
		var argname = pairs[i].substr(0,pos);
		var value = pairs[i].substr(pos+1);
		args[argname] = value;
	}
	return args[strParame];
}
	